programming4us
           
 
 
SQL Server

SQL Server 2008 : SQL Server Service Broker - Designing a Sample System

- Free product key for windows 10
- Free Product Key for Microsoft office 365
- Malwarebytes Premium 3.7.1 Serial Keys (LifeTime) 2019
12/27/2010 11:36:47 AM
The sample messaging system used in this article has the following design: an update stored procedure in AdventureWorks2008.Production.ProductModel starts up a service that initiates a conversation with a service in XCatMgmt. It does this by sending a message to the inbound work queue of XCatMgmt. When the transaction surrounding the initial send is complete, Service Broker transmits the message, signaling that a catalog change for an AdventureWorks Cycles product model is ready for processing.

In response to the arrival of this new message, Service Broker executes a stored procedure associated with a catalog maintenance service for XCatMgmt, known as its service program. This process is known as internal activation; it is internal because the stored procedure resides in and is activated by SQL Server.

Because a Service Broker program might not always be a stored procedure, external activation is also available when you use event notification with the QUEUE_ACTIVATION event. You can create an event notification service and map it to your Service Broker service and queue by using syntax such as the following:

CREATE QUEUE NotificationQueue
GO
CREATE SERVICE EventNotificationService
ON QUEUE NotificationQueue
([http://schemas.microsoft.com/SQL/Notifications/PostEventNotification])
GO
CREATE EVENT NOTIFICATION NotifyMe
ON QUEUE NotificationQueue FOR QUEUE_ACTIVATION
TO SERVICE 'EventNotificationService', 'broker-instance-guid'

Note that you need to retrieve your database’s Service Broker unique identifier and replace 'broker-instance-guid' with it for the example to work. To do this, you run the following query:

SELECT service_broker_guid
FROM sys.databases
WHERE NAME = 'AdventureWorks2008'
go
service_broker_guid
-------------------------------------
3036906E-8B9E-4266-A8C6-DD4E01B656CA
(1 row(s) affected)

Let’s return to the sample system’s description. When the catalog maintenance service’s work is done, it sends an acknowledgment message back to the sender’s inbound queue.

To accomplish everything included in the design so far, you need to represent the following kinds of objects in the system:

  • Two types of messages: one defining product model catalog changes and one for acknowledgments

  • Two queues, one for each service

  • One contract that defines the message flow between the services

  • Two services, each representing an endpoint in the system

  • At least one conversation and its related conversation group

The following sections describe how to define and build on all these new constructs, and you learn how they work together in the orchestration of Service Broker applications.

Other -----------------
- Migrating Databases and Data to SQL Azure (part 4) - Fixing the Script
- Migrating Databases and Data to SQL Azure (part 3) - Reviewing the Generated Script
- SQL Server 2008 : SQL Server Service Broker - Understanding Distributed Messaging
- SQL Server 2008 : Full-Text Search Troubleshooting
- Migrating Databases and Data to SQL Azure (part 2)
- Migrating Databases and Data to SQL Azure (part 1) - Generate and Publish Scripts Wizard
- SQL Azure : Security - Access Control
- SQL Server 2008 : Full-Text Searches (part 3) - Stop Lists
- SQL Server 2008 : Full-Text Searches (part 2)
- SQL Server 2008 : Full-Text Searches (part 1) - Search Phrase
- SQL Azure : Securing Your Data (part 3) - Certificates
- SQL Azure : Securing Your Data (part 2) - Hashing
- SQL Azure : Securing Your Data (part 1) - Encryption
- SQL Azure : Security - Overview
- Setting Up a Full-Text Index (part 4) - Using the Full-Text Indexing Wizard to Build Full-Text Indexes and Catalogs
- Setting Up a Full-Text Index (part 3) - Diagnostics
- Setting Up a Full-Text Index (part 2) - Full-Text Indexing of BLOBs and XML
- Setting Up a Full-Text Index (part 1) - Using T-SQL Commands to Build Full-Text Indexes and Catalogs
- Implementing SQL Server 2008 Full-Text Catalogs
- How SQL Server FTS Works
 
 
 
Top 10
 
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 2) - Wireframes,Legends
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 1) - Swimlanes
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Formatting and sizing lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Adding shapes to lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Sizing containers
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 3) - The Other Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 2) - The Data Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 1) - The Format Properties of a Control
- Microsoft Access 2010 : Form Properties and Why Should You Use Them - Working with the Properties Window
- Microsoft Visio 2013 : Using the Organization Chart Wizard with new data
- First look: Apple Watch

- 3 Tips for Maintaining Your Cell Phone Battery (part 1)

- 3 Tips for Maintaining Your Cell Phone Battery (part 2)
programming4us programming4us